﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class middle : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            companylist.Visible = false;
            trUserRole.Visible = false;
            trUserType.Visible = false;

            if (Session["Permission"] != null)
            {
                Permission permission = Session["Permission"] as Permission;
                if (permission.EUserRole != EUserRole.user)//违章
                {
                    companylist.Visible = true;
                }
                if (permission.IsUserTypeEdit)
                {
                    trUserRole.Visible = true;
                }
                if (permission.IsUserRoleEdit)
                {
                    trUserType.Visible = true;
                }
            }
            
        }
    }
}